#pragma once

typedef enum _MONITOR_OPERATION_MODE
{
	invalidOperation	= 0,
	monitorTraffic		= 1,
	monitorOperationMax

} MONITOR_OPERATION_MODE;

#define DEFAULT_EVENT_NUM 3

typedef struct _MONITOR_SETTINGS
{
	MONITOR_OPERATION_MODE	monitorOperation;
	UINT32 flags;
	//hInforEvents[DEFAULT_EVENT_NUM-1] is reserved.
	HANDLE hInforEvents[DEFAULT_EVENT_NUM];

} MONITOR_SETTINGS;

#define MAX_PROCESS_PATH_SIZE 32

typedef struct _MONITOR_INFORMATION
{
	UINT64		receivedBytes;
	UINT64		sentBytes;
	UINT64		totalSetnBytes;
	UINT64		totalRecvBytes;
	UINT64		processId;
	USHORT		ipProto;
	WCHAR		processPath[MAX_PROCESS_PATH_SIZE];
	

}MONITOR_INFORMATION, *PMONITOR_INFORMATION;

#define SIZEOF_MONITOR_INFORMATION sizeof(MONITOR_INFORMATION)

#define MAX_NUM_OF_INFORMATION 100

typedef struct _MONITOR_INFORMATIONS
{
	UINT32 numMonitorInformations;
	MONITOR_INFORMATION monitorInformation[MAX_NUM_OF_INFORMATION];

}MONITOR_INFORMATIONS, *PMONITOR_INFORMATIONS;

#define SIZEOF_MONITOR_INFORMATIONS  sizeof(MONITOR_INFORMATIONS)  //5608bytes

typedef struct _REGISTER_EVENT
{
	HANDLE  hEvent;
	LARGE_INTEGER DueTime; // requested DueTime in 100-nanosecond units

} REGISTER_EVENT, *PREGISTER_EVENT;

#define SIZEOF_REGISTER_EVENT  sizeof(REGISTER_EVENT)

#define	MONITOR_IOCTL_ENABLE_MONITOR  CTL_CODE(FILE_DEVICE_NETWORK, 0x1, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define	MONITOR_IOCTL_DISABLE_MONITOR CTL_CODE(FILE_DEVICE_NETWORK, 0x2, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define	MONITOR_IOCTL_GETINFO_MONITOR CTL_CODE(FILE_DEVICE_NETWORK, 0x3, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define	MONITOR_IOCTL_GETINFOS_MONITOR CTL_CODE(FILE_DEVICE_NETWORK, 0x4, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define MONITOR_IOCTL_REGISTER_EVENT  CTL_CODE(FILE_DEVICE_NETWORK, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)


#define MONITOR_DEVICE_NAME     L"\\Device\\NetworkMonitor"
#define MONITOR_SYMBOLIC_NAME   L"\\DosDevices\\Global\\NetworkMonitor"
#define MONITOR_DOS_NAME   L"\\\\.\\NetworkMonitor"

#define DRIVER_NAME L"NetworkMnt"

#define DRIVER_FUNC_INSTALL     0x01
#define DRIVER_FUNC_REMOVE      0x02